home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Window / c / ParentName < prev    next >
Text File  |  1995-09-02  |  2KB  |  56 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Window.ParentName.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.     Version: 1.00 (19 Mar 1992)
  14.     Purpose: High-level window management functions: Return template window
  15.              was created from (if known)
  16. */
  17.  
  18.  
  19. #include <string.h>
  20.  
  21. #include "DeskLib:LinkList.h"
  22. #include "DeskLib:Window.h"
  23.  
  24. #include "WindowDefs.h"
  25.  
  26. extern linklist_header window_listanchor;
  27.  
  28.  
  29.  
  30. extern void Window_ParentName(window_handle window, char *windowname)
  31. {
  32.   windowrec     *record;
  33.  
  34.   if (window < 0)
  35.   {
  36.     strcpy(windowname, "iconbar");
  37.     return;
  38.   }
  39.  
  40.   windowname[0] = '\0';     /* in case window not found, ensure valid output */
  41.  
  42.   record = (windowrec *) window_listanchor.next;
  43.   while (record != NULL)
  44.   {
  45.     if (window == record->window)
  46.       break;
  47.     record = (windowrec *) record->header.next;
  48.   }
  49.  
  50.   if (record != NULL)
  51.   {
  52.     strncpy(windowname, record->templatename, wimp_MAXNAME);
  53.     windowname[wimp_MAXNAME - 1] = 0;
  54.   }
  55. }
  56.